package br.usp.pcs.poli.lti.iToo.tutor.model;

import br.usp.pcs.poli.lti.iToo.model.ClassModel;
import ilm.framework.assignment.model.DomainAction;
import ilm.framework.domain.DomainModel;

public class AddClassDomainAction extends DomainAction {

	private ITooDomainModel _model;
	private ClassDomainObject _class;
	
	public AddClassDomainAction(String name, String description) {
		super(name, description);
		ClassModel _model = null;
		try {
			_model = new ClassModel(name, Class.forName("String"));
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		_class = new ClassDomainObject(name, description, _model);
	}

	@Override
	public void setDomainModel(DomainModel model) {
		_model = (ITooDomainModel)model;
	}

	@Override
	protected void executeAction() {
		_model.AddClassAction(_currentState, _class);
	}

	@Override
	protected void undoAction() {
		_model.RemoveClassAction(_currentState, _class);
	}

	@Override
	public boolean equals(DomainAction a) {
		// TODO Auto-generated method stub
		return false;
	}

}
